Release 10.1A: OpenEdge Getting Started:
Database Essentials


Calculating database storage requirements

The OpenEdge database engine stores all database fields and indexes in variable-length format and does not store trailing blanks in character fields or leading zeros in numeric fields. The benefits of this variable-length storage technique are:

Table 4–1 lists the formulas you use to calculate the field storage values (in bytes) for different data types.

Table 4–1: Formulas for calculating field storage
4GL Data type (SQL equivalent)
Value
Field storage in bytes
CHARACTER
(VARCHAR)
Character string

1 + number of characters, excluding trailing blanks. If the number of characters is greater than 240, add 3 to the number of characters instead of 1.

DATE
(DATE)
Date
3
DECIMAL
(DECIMAL or
NUMERIC)
Zero
1
Nonzero
2 + (number of significant digits + 1) / 2
INTEGER
(INTEGER)
Zero to 126
1
127 to 32,766
2
32,767 to 7.99 million
3
8 million to 1.99 billion
4
2 billion
5
LOGICAL
(BIT)
False
1
True
2

For example, you calculate the estimated database size for a database with a single customer table as follows.

The table has three fields:

The table is indexed on just one field (Name) and you would expect to have about 500,000 records in the customer table. Table 4–2 lists formulas (and examples) for estimating the size of your database.

Table 4–2: Calculating database size 
Database component
Size
Schema
=  421,000 (This number is the size of an empty database with 
the schema loaded in.)
Field storage
= Cust-num + Name + Start-date
= 3 + 21 + 3 
= 27
Customer table
= number of records x field storage x 1.5
= 500,000 x 27 x  1.5 
= 20,250,000
Name index
= number of records x (7 + number of fields in index +
    index field storage
 ) x  2 
= 500,000 x (7 + 1 + 21) x 2 
= 29,000,000
Database
= schema size + data table size + index size
= 421,000 + 20,250,000 + 29,000,000 
= 49,671,000 bytes

These formulas are conservative since they often result in a large estimate of your database size. However, you also must allow for temporary disk space for each database user for the following purposes:

Database-related size criteria

When planning the size of your database, use the formulas listed in Table 4–3 to calculate the approximate amount of disk space (in bytes) required for a database. See OpenEdge Data Management: Database Administration for limits on any of these elements.

Table 4–3: Formulas for calculating database size 
Size
Formula
Database size
schema size + data table size + index size.
Schema size
Typically, between 1 and 100MB1.
Data table size
Sum of individual table sizes.
Individual table size
number of records x field storage x 1.5.
Index size
Sum of individual index sizes.
Individual index size
number of records in the table being indexed   x
(7 + number of fields index +field storage)  x 2.
  1. 1To determine the schema size, load the schema into an empty database and check the size of your database—this is the size of your schema.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095